package queueDemo;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.PriorityBlockingQueue;

public class Demo8 {
    public static void main(String[] args) throws InterruptedException {
            BlockingQueue<Integer> queue = new PriorityBlockingQueue<>();
            queue.put(3);
            queue.put(1);
            queue.put(2);
            System.out.println(queue.take()); // 输出1
        }
    }
